﻿<% @title = "#{t :trasach}" %>
<h3><%= t :trasach%></h3>

<% if(session[:user_id]==nil) %>
  <h4><%= t :dangnhapthuchien %></h4>
  <br/>
  <p><%= link_to "=> #{t :dangnhap}", login_path %></p>
<%else%>
  <% @user = User.find(session[:user_id]) %>
  <% if(@user.GroupUserId!=10) %>
      <h4><%= t :dangnhapthuchienAdmin %></h4>
      <br/>
      <p><%= link_to "=> #{t :dangnhap}", login_path %></p>
  <%else%>

<%= form_tag ('/borrowedtables/pay')%>
    <p>
  <p><b><%= t :nguoitrasach%></b></p>
  <%@User= User.all%>
  <%array = @User.map {|p| [ p.firstName+ p.lastName, p.firstName + p.lastName ] }%>
  
  <%= select_tag "paybook", options_for_select(array) %>
  <p><b> <%= t :matrasach%> </b></p>
  <% @Product = Product.all %>
  <% array1   = @Product.map {|p| [ p.product_id, p.product_id  ] }%>
  <%= select_tag "paybook1", options_for_select(array1) %>
  </br>
  <%= submit_tag "#{t :trasach}" %> 
</p>
<% end %> 
<%end%>
